<!doctype html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:include="include :: header"></head>
<body>
<form class="layui-form" style="padding: 15px;">
    <div class="layui-inline">
        <label class="layui-form-label">项目名称</label>
        <div class="layui-input-inline">
            <input type="text" id="projectName" autocomplete="off"
                   class="layui-input">
        </div>
    </div>
    <div class="layui-inline">
        <label class="layui-form-label">项目等级</label>
        <div class="layui-input-inline">
            <select id="projectLevel">
                <option value="">全部</option>
                <option value="T">T</option>
                <option value="A">A</option>
                <option value="B">B</option>
                <option value="C">C</option>
                <option value="W">W</option>
            </select>
        </div>
    </div>
    <button class="layui-btn layui-btn-sm"><i class="layui-icon"></i>
    </button>
</form>

<table id="epointprojectList" class="layui-hide" lay-filter="epointproject"></table>

<script type="text/html" id="toolbarTable">
    <button class="layui-btn layui-btn-sm" shiro:hasPermission="system:epointproject:add"
            onclick="openWindow('添加项目信息','/venus/project/epointproject/add')"><i
            class="layui-icon"></i>添加
    </button>
</script>

<script type="text/html" id="toolbar">
    <a class="layui-btn layui-btn-xs layui-btn-primary" lay-event="view">查看</a>
    <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
    <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
</script>
<div th:include="include :: footer"></div>

<script>
    var sysUrl = '/venus/project/epointproject';
    layui.use(['table'], function () {
        var table = layui.table;
        table.render({
            id: 'epointprojectList',
            elem: '#epointprojectList',
            method: 'post',
            height: 'full-100',
            toolbar: '#toolbarTable',
            defaultToolbar: ['print', 'exports'],
            cellMinWidth: 100,
            url: sysUrl + '/list',
            cols: [
                [
                    {field: 'num', width: 50, title: '序号', type: 'numbers'},
                    {field: 'projectName', width: 370, title: '项目名称'},
                    {
                        field: 'projectLv', width: 100, title: '项目等级', templet: function (d) {
                            return d.projectLevel + '级';
                        }
                    },
                    {field: 'devContact', title: '开发联系人'},
                    {field: 'proContact', title: '实施联系人'},
                    {field: 'province', width: 100, title: '所在省份'},
                    {field: 'city', width: 100, title: '所在县区'},
                    {field: 'remark', title: '备注'},
                    {fixed: 'right', title: '操作', width: 178, toolbar: "#toolbar"}
                ]
            ]
            , page: true
        });

        //监听行工具事件
        table.on('tool(epointproject)', function (obj) {
            delAndEdit(sysUrl, obj, 'project');
        });
        //搜索
        $('.layui-form .layui-btn').on('click', function () {
            table.reload('epointprojectList', {
                where: {
                    projectName: $("#projectName").val(),
                    projectLevel: $("#projectLevel").val()
                }
            });
            return false;
        });
    });
</script>
</body>
</html>